var a = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../utils/util.js")), t = getApp();

Page({
    data: {
        page: 1,
        id: wx.getStorageSync("yz_uid"),
        nowTime: Date.parse(new Date()) / 1e3
    },
    onLoad: function(a) {
        this.getdata(), console.log(this.data.nowTime);
    },
    onReady: function() {},
    goxq: function(a) {
        var t = a.currentTarget.id;
        wx.navigateTo({
            url: "/packageC/Myshaky/enrollEnter/enrollEnter?id=" + t
        });
    },
    getdata: function() {
        var e = t.getNetAddresss("plugin.activity-apply.api.lecturer.getMyActivity"), i = this;
        t._getNetWork({
            url: e,
            data: {
                member_id: i.data.id,
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                if (1 == e.result) {
                    console.log(e.data);
                    for (var n = 0; n < e.data.data.length; n++) e.data.data[n].has_many_activity[0].start_time = a.default.formatTimeTwo(e.data.data[n].has_many_activity[0].start_time, "Y/M/D h:m:s");
                    console.log(e.data.data), i.setData({
                        dataLis: e.data.data,
                        current_page: e.data.current_page,
                        last_page: e.data.last_page
                    });
                }
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page < this.data.last_page ? (wx.showLoading({
            title: "加载中",
            mask: !0
        }), this.setData({
            page: this.data.page + 1
        }), this.getNext()) : wx.showToast({
            title: "没有更多",
            icon: "none"
        });
    },
    getNext: function() {
        var a = t.getNetAddresss("plugin.activity-apply.api.lecturer.getMyActivity"), e = this;
        t._getNetWork({
            url: a,
            data: {
                member_id: e.data.id,
                page: this.data.page
            },
            success: function(a) {
                var t = a.data;
                if (1 == t.result) {
                    console.log(t.data);
                    for (var i = 0; i < t.data.data.length; i++) console.log(t.data.data[i].has_many_activity[0]);
                    if (t.data.current_page > t.data.last_page) return wx.hideLoading(), wx.showToast({
                        title: "没有更多",
                        icon: "none"
                    }), void e.setData({
                        current_page: t.data.current_page,
                        last_page: t.data.last_page
                    });
                    wx.hideLoading(), e.setData({
                        dataLis: e.data.dataLis.concat(t.data.data),
                        current_page: t.data.current_page,
                        last_page: t.data.last_page
                    });
                }
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onShareAppMessage: function() {}
});